import { ReactNode } from "react"

export interface TreeProps {
	treeData: Array<any>
	defaultExpandedKeys?: Array<any>
	customUpdateTreeData: (currentTreeData: DataNode[], parentNodeKey: string) => Promise<DataNode[]>
	onSetTreeData?: (data: DataNode[]) => void // // The callback function for setting tree data provided by the parent component
	fieldNames?: { key?: string; title?: string; children?: string }
	onExpand?: () => void
	maxHeight?: number
	maxWidth?: number
}

export interface DataNode {
	title: string
	key: string
	isLeaf?: boolean
	children?: DataNode[]
	icon?: ReactNode
}

export interface LoadDataParams {
	key: string
	children?: any[]
}
